import selectTooltip from './selectTooltip'
import visibleColumn from './visibleColumn'
import yzConditionFilter from './yzConditionFilter'
import basicDialog from './basic-dialog'
import progressBar from './progress-bar'
import fuzzySearch from './fuzzy-search'
import yzInput from './yz-input'
import yzPagination from './yz-pagination'
import uploadPicture from './upload-picture'
import detailDialog from './detail-dialog'
import setColor from './set-color'
import tableBtn from './table-btn'
import tdSpec from './td-spec'
import transferCommon from './transfer-common'
import setUserCommon from './set-user-common'
import flowsheetCommon from './flowsheet-common'
import imgRecord from './img-record'
import downloadBtn from './template/download-btn'
import uploadBtn from './template/upload-btn'
import exportBtn from './export-btn/export-btn'
import tips from './tips'
import { workshopInput, workshopSearch } from './workshop-search'
// 存储组件列表
const components = {
  selectTooltip,
  visibleColumn,
  yzConditionFilter,
  basicDialog,
  progressBar,
  fuzzySearch,
  yzInput,
  yzPagination,
  uploadPicture,
  detailDialog,
  setColor,
  tableBtn,
  tdSpec,
  transferCommon,
  setUserCommon,
  flowsheetCommon,
  imgRecord,
  downloadBtn,
  uploadBtn,
  exportBtn,
  workshopInput,
  workshopSearch,
  tips
}
/*
  定义install 方法，接收Vue作为参数，如果使用use注册插件，则所有的组件都将被注册
*/
const install = Vue => {
  if (install.installed) { return }
  Object.keys(components).forEach(com => {
    Vue.component(components[com].name, components[com])
  })
}
// 判断是否引入文件
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}
const comIstall = {
  ...components,
  install
}
export default comIstall
